const baseUrl = 'https://112.74.74.239/prod-api'   
const request = (url = '', data = {}, method = 'GET', loadding=false,header = {
'content-type':'application/json'
//'content-type':'multipart/form-data',
}) => {
    return new Promise((resolve, reject) => {
		console.log({
			url: baseUrl + url,
			method,
		});
		loadding && uni.showLoading()
        uni.request({
			url: baseUrl + url,
            method,
            data,
            header,
            dataType: 'json',         
        }).then((response) => {
            setTimeout(function() {
                uni.hideLoading();
            }, 200);
			console.log("成功");
            let {error, data} = response;        
			console.log("res",data);
            resolve(data);
        }).catch(error => {
			console.log("失败",error);  
            reject(error)
        })
    });
}
export default request